CREATE TABLE [dbo].[DISC_DistOrderItems]
(
[ID] [int] NOT NULL IDENTITY(1, 1) NOT FOR REPLICATION,
[DistID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PermID] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OrderID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[NetPrice] [decimal] (18, 2) NOT NULL,
[DateTime] [datetime] NULL,
[DownloadLink] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GenerationStatus] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GenerationError] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MaxDownloads] [int] NOT NULL,
[StampVars] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Promo] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[usersID] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Password] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FileName] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[DISC_DistOrderItems] ADD CONSTRAINT [PK_DISC_DistOrderItems] PRIMARY KEY CLUSTERED  ([ID]) WITH (FILLFACTOR=85) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DISC_DistOrderItems_DistID_DateTime] ON [dbo].[DISC_DistOrderItems] ([DistID], [DateTime]) ON [PRIMARY]
GO
